import {
    trigger,
    state,
    style,
    animate,
    transition,
    // ...
} from '@angular/animations';


export const openClose = trigger('openClose',[
    // state() 函数来定义不同的状态，供每次专场结束时调用。
    state('open',style({
        height: '200px',
        opacity: 1,
        color: '#000000',
        backgroundColor: '#fef4a9',
    })),
    state('closed',style({
        height: '100px',
        opacity: 0.5,
        backgroundColor: '#3b9a9c'
    })),
    // transition() 定义了两个状态之间进行转场的时候发生变化的过程
    transition('open => closed',[
        animate('.4s'),
    ]),
    transition('closed => open',[
        animate('0.8s')
    ])
])